package com.example.lenovo.tianqi.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;

import com.example.lenovo.tianqi.R;

/**
 * Created by lenovo on 2018/1/9.
 */

public class AboutActivity extends AppCompatActivity implements View.OnClickListener{
    public Toolbar toolbar;
    private Button about_code;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        initView();
    }

    private void initView() {
        about_code=findViewById(R.id.about_bt_code);
        toolbar=findViewById(R.id.about_toolbar);
        setSupportActionBar(toolbar);
        about_code.setOnClickListener(this);
        toolbar.setNavigationIcon(R.mipmap.ic_arrow_back_white);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent();
        intent.setAction(Intent.ACTION_VIEW);//为Intent设置动作
        String data="https://github.com/1006112544/IWeather";//获取编辑框里面的文本内容
        intent.setData(Uri.parse(data));//为intent设置数据
        startActivity(intent);//将intent传给activity
    }
}
